\(\int \frac {a+b \sin (e+f x)}{(c+d x)^2} \, dx\) [155]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [C] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 18, antiderivative size = 88 \[ \int \frac {a+b \sin (e+f x)}{(c+d x)^2} \, dx=-\frac {a}{d (c+d x)}+\frac {b f \cos \left (e-\frac {c f}{d}\right ) \operatorname {CosIntegral}\left (\frac {c f}{d}+f x\right )}{d^2}-\frac {b \sin (e+f x)}{d (c+d x)}-\frac {b f \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (\frac {c f}{d}+f x\right )}{d^2} \]

[Out]

-a/d/(d*x+c)+b*f*Ci(c*f/d+f*x)*cos(-e+c*f/d)/d^2+b*f*Si(c*f/d+f*x)*sin(-e+c*f/d)/d^2-b*sin(f*x+e)/d/(d*x+c)

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {3398, 3378, 3384, 3380, 3383} \[ \int \frac {a+b \sin (e+f x)}{(c+d x)^2} \, dx=-\frac {a}{d (c+d x)}+\frac {b f \operatorname {CosIntegral}\left (x f+\frac {c f}{d}\right ) \cos \left (e-\frac {c f}{d}\right )}{d^2}-\frac {b f \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (x f+\frac {c f}{d}\right )}{d^2}-\frac {b \sin (e+f x)}{d (c+d x)} \]

[In]

Int[(a + b*Sin[e + f*x])/(c + d*x)^2,x]

[Out]

-(a/(d*(c + d*x))) + (b*f*Cos[e - (c*f)/d]*CosIntegral[(c*f)/d + f*x])/d^2 - (b*Sin[e + f*x])/(d*(c + d*x)) -
(b*f*Sin[e - (c*f)/d]*SinIntegral[(c*f)/d + f*x])/d^2

Rule 3378

Int[((c_.) + (d_.)*(x_))^(m_)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(c + d*x)^(m + 1)*(Sin[e + f*x]/(d*(m
 + 1))), x] - Dist[f/(d*(m + 1)), Int[(c + d*x)^(m + 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && LtQ[
m, -1]

Rule 3380

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinIntegral[e + f*x]/d, x] /; FreeQ[{c, d,
 e, f}, x] && EqQ[d*e - c*f, 0]

Rule 3383

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosIntegral[e - Pi/2 + f*x]/d, x] /; FreeQ
[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]

Rule 3384

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Dist[Cos[(d*e - c*f)/d], Int[Sin[c*(f/d) + f*x]
/(c + d*x), x], x] + Dist[Sin[(d*e - c*f)/d], Int[Cos[c*(f/d) + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f},
x] && NeQ[d*e - c*f, 0]

Rule 3398

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[ExpandIntegrand[
(c + d*x)^m, (a + b*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 0] && (EqQ[n, 1] ||
IGtQ[m, 0] || NeQ[a^2 - b^2, 0])

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {a}{(c+d x)^2}+\frac {b \sin (e+f x)}{(c+d x)^2}\right ) \, dx \\ & = -\frac {a}{d (c+d x)}+b \int \frac {\sin (e+f x)}{(c+d x)^2} \, dx \\ & = -\frac {a}{d (c+d x)}-\frac {b \sin (e+f x)}{d (c+d x)}+\frac {(b f) \int \frac {\cos (e+f x)}{c+d x} \, dx}{d} \\ & = -\frac {a}{d (c+d x)}-\frac {b \sin (e+f x)}{d (c+d x)}+\frac {\left (b f \cos \left (e-\frac {c f}{d}\right )\right ) \int \frac {\cos \left (\frac {c f}{d}+f x\right )}{c+d x} \, dx}{d}-\frac {\left (b f \sin \left (e-\frac {c f}{d}\right )\right ) \int \frac {\sin \left (\frac {c f}{d}+f x\right )}{c+d x} \, dx}{d} \\ & = -\frac {a}{d (c+d x)}+\frac {b f \cos \left (e-\frac {c f}{d}\right ) \operatorname {CosIntegral}\left (\frac {c f}{d}+f x\right )}{d^2}-\frac {b \sin (e+f x)}{d (c+d x)}-\frac {b f \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (\frac {c f}{d}+f x\right )}{d^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.26 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.82 \[ \int \frac {a+b \sin (e+f x)}{(c+d x)^2} \, dx=\frac {b f \cos \left (e-\frac {c f}{d}\right ) \operatorname {CosIntegral}\left (f \left (\frac {c}{d}+x\right )\right )-\frac {d (a+b \sin (e+f x))}{c+d x}-b f \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (f \left (\frac {c}{d}+x\right )\right )}{d^2} \]

[In]

Integrate[(a + b*Sin[e + f*x])/(c + d*x)^2,x]

[Out]

(b*f*Cos[e - (c*f)/d]*CosIntegral[f*(c/d + x)] - (d*(a + b*Sin[e + f*x]))/(c + d*x) - b*f*Sin[e - (c*f)/d]*Sin
Integral[f*(c/d + x)])/d^2

Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.39

method result size
parts \(-\frac {a}{d \left (d x +c \right )}+b f \left (-\frac {\sin \left (f x +e \right )}{\left (c f -d e +d \left (f x +e \right )\right ) d}+\frac {\frac {\operatorname {Si}\left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}+\frac {\operatorname {Ci}\left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d}}{d}\right )\) \(122\)
derivativedivides \(\frac {-\frac {f^{2} a}{\left (c f -d e +d \left (f x +e \right )\right ) d}+f^{2} b \left (-\frac {\sin \left (f x +e \right )}{\left (c f -d e +d \left (f x +e \right )\right ) d}+\frac {\frac {\operatorname {Si}\left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}+\frac {\operatorname {Ci}\left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d}}{d}\right )}{f}\) \(141\)
default \(\frac {-\frac {f^{2} a}{\left (c f -d e +d \left (f x +e \right )\right ) d}+f^{2} b \left (-\frac {\sin \left (f x +e \right )}{\left (c f -d e +d \left (f x +e \right )\right ) d}+\frac {\frac {\operatorname {Si}\left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}+\frac {\operatorname {Ci}\left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d}}{d}\right )}{f}\) \(141\)
risch \(-\frac {a}{d \left (d x +c \right )}-\frac {f b \,{\mathrm e}^{\frac {i \left (c f -d e \right )}{d}} \operatorname {Ei}_{1}\left (i f x +i e +\frac {i \left (c f -d e \right )}{d}\right )}{2 d^{2}}-\frac {f b \,{\mathrm e}^{-\frac {i \left (c f -d e \right )}{d}} \operatorname {Ei}_{1}\left (-i f x -i e -\frac {i c f -i d e}{d}\right )}{2 d^{2}}-\frac {b \left (-2 d x f -2 c f \right ) \sin \left (f x +e \right )}{2 d \left (d x +c \right ) \left (-d x f -c f \right )}\) \(154\)

[In]

int((a+b*sin(f*x+e))/(d*x+c)^2,x,method=_RETURNVERBOSE)

[Out]

-a/d/(d*x+c)+b*f*(-sin(f*x+e)/(c*f-d*e+d*(f*x+e))/d+(Si(f*x+e+(c*f-d*e)/d)*sin((c*f-d*e)/d)/d+Ci(f*x+e+(c*f-d*
e)/d)*cos((c*f-d*e)/d)/d)/d)

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.19 \[ \int \frac {a+b \sin (e+f x)}{(c+d x)^2} \, dx=\frac {{\left (b d f x + b c f\right )} \cos \left (-\frac {d e - c f}{d}\right ) \operatorname {Ci}\left (\frac {d f x + c f}{d}\right ) - b d \sin \left (f x + e\right ) + {\left (b d f x + b c f\right )} \sin \left (-\frac {d e - c f}{d}\right ) \operatorname {Si}\left (\frac {d f x + c f}{d}\right ) - a d}{d^{3} x + c d^{2}} \]

[In]

integrate((a+b*sin(f*x+e))/(d*x+c)^2,x, algorithm="fricas")

[Out]

((b*d*f*x + b*c*f)*cos(-(d*e - c*f)/d)*cos_integral((d*f*x + c*f)/d) - b*d*sin(f*x + e) + (b*d*f*x + b*c*f)*si
n(-(d*e - c*f)/d)*sin_integral((d*f*x + c*f)/d) - a*d)/(d^3*x + c*d^2)

Sympy [F]

\[ \int \frac {a+b \sin (e+f x)}{(c+d x)^2} \, dx=\int \frac {a + b \sin {\left (e + f x \right )}}{\left (c + d x\right )^{2}}\, dx \]

[In]

integrate((a+b*sin(f*x+e))/(d*x+c)**2,x)

[Out]

Integral((a + b*sin(e + f*x))/(c + d*x)**2, x)

Maxima [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.27 (sec) , antiderivative size = 196, normalized size of antiderivative = 2.23 \[ \int \frac {a+b \sin (e+f x)}{(c+d x)^2} \, dx=-\frac {\frac {2 \, a f^{2}}{{\left (f x + e\right )} d^{2} - d^{2} e + c d f} - \frac {{\left (f^{2} {\left (-i \, E_{2}\left (\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right ) + i \, E_{2}\left (-\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right )\right )} \cos \left (-\frac {d e - c f}{d}\right ) + f^{2} {\left (E_{2}\left (\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right ) + E_{2}\left (-\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right )\right )} \sin \left (-\frac {d e - c f}{d}\right )\right )} b}{{\left (f x + e\right )} d^{2} - d^{2} e + c d f}}{2 \, f} \]

[In]

integrate((a+b*sin(f*x+e))/(d*x+c)^2,x, algorithm="maxima")

[Out]

-1/2*(2*a*f^2/((f*x + e)*d^2 - d^2*e + c*d*f) - (f^2*(-I*exp_integral_e(2, (I*(f*x + e)*d - I*d*e + I*c*f)/d)
+ I*exp_integral_e(2, -(I*(f*x + e)*d - I*d*e + I*c*f)/d))*cos(-(d*e - c*f)/d) + f^2*(exp_integral_e(2, (I*(f*
x + e)*d - I*d*e + I*c*f)/d) + exp_integral_e(2, -(I*(f*x + e)*d - I*d*e + I*c*f)/d))*sin(-(d*e - c*f)/d))*b/(
(f*x + e)*d^2 - d^2*e + c*d*f))/f

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 533 vs. \(2 (89) = 178\).

Time = 0.33 (sec) , antiderivative size = 533, normalized size of antiderivative = 6.06 \[ \int \frac {a+b \sin (e+f x)}{(c+d x)^2} \, dx=\frac {{\left ({\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} f^{2} \cos \left (-\frac {d e - c f}{d}\right ) \operatorname {Ci}\left (\frac {{\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d e + c f}{d}\right ) - d e f^{2} \cos \left (-\frac {d e - c f}{d}\right ) \operatorname {Ci}\left (\frac {{\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d e + c f}{d}\right ) + c f^{3} \cos \left (-\frac {d e - c f}{d}\right ) \operatorname {Ci}\left (\frac {{\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d e + c f}{d}\right ) + {\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} f^{2} \sin \left (-\frac {d e - c f}{d}\right ) \operatorname {Si}\left (\frac {{\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d e + c f}{d}\right ) - d e f^{2} \sin \left (-\frac {d e - c f}{d}\right ) \operatorname {Si}\left (\frac {{\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d e + c f}{d}\right ) + c f^{3} \sin \left (-\frac {d e - c f}{d}\right ) \operatorname {Si}\left (\frac {{\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d e + c f}{d}\right ) + d f^{2} \sin \left (-\frac {{\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )}}{d}\right )\right )} b d^{2}}{{\left ({\left (d x + c\right )} d^{4} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d^{5} e + c d^{4} f\right )} f} - \frac {a}{{\left (d x + c\right )} d} \]

[In]

integrate((a+b*sin(f*x+e))/(d*x+c)^2,x, algorithm="giac")

[Out]

((d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f)*f^2*cos(-(d*e - c*f)/d)*cos_integral(((d*x + c)*(d*e/(d*x + c)
- c*f/(d*x + c) + f) - d*e + c*f)/d) - d*e*f^2*cos(-(d*e - c*f)/d)*cos_integral(((d*x + c)*(d*e/(d*x + c) - c*
f/(d*x + c) + f) - d*e + c*f)/d) + c*f^3*cos(-(d*e - c*f)/d)*cos_integral(((d*x + c)*(d*e/(d*x + c) - c*f/(d*x
 + c) + f) - d*e + c*f)/d) + (d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f)*f^2*sin(-(d*e - c*f)/d)*sin_integra
l(((d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f) - d*e + c*f)/d) - d*e*f^2*sin(-(d*e - c*f)/d)*sin_integral(((
d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f) - d*e + c*f)/d) + c*f^3*sin(-(d*e - c*f)/d)*sin_integral(((d*x +
c)*(d*e/(d*x + c) - c*f/(d*x + c) + f) - d*e + c*f)/d) + d*f^2*sin(-(d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) +
 f)/d))*b*d^2/(((d*x + c)*d^4*(d*e/(d*x + c) - c*f/(d*x + c) + f) - d^5*e + c*d^4*f)*f) - a/((d*x + c)*d)

Mupad [F(-1)]

Timed out. \[ \int \frac {a+b \sin (e+f x)}{(c+d x)^2} \, dx=\int \frac {a+b\,\sin \left (e+f\,x\right )}{{\left (c+d\,x\right )}^2} \,d x \]

[In]

int((a + b*sin(e + f*x))/(c + d*x)^2,x)

[Out]

int((a + b*sin(e + f*x))/(c + d*x)^2, x)